package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

cc_library(
    name = "raw_jwt_hmac_key_manager",
    srcs = ["raw_jwt_hmac_key_manager.cc"],
    hdrs = ["raw_jwt_hmac_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    visibility = ["//visibility:public"],
    deps = [
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:input_stream",
        "//:mac",
        "//internal:fips_utils",
        "//proto:common_cc_proto",
        "//proto:jwt_hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:hmac_boringssl",
        "//subtle:random",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:input_stream_util",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "raw_jwt_hmac_key_manager_test",
    size = "small",
    srcs = ["raw_jwt_hmac_key_manager_test.cc"],
    deps = [
        ":raw_jwt_hmac_key_manager",
        "//:core/key_manager_impl",
        "//:mac",
        "//:tink_cc",
        "//config:global_registry",
        "//mac:mac_config",
        "//proto:jwt_hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//util:istream_input_stream",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "json_util",
    srcs = ["json_util.cc"],
    hdrs = ["json_util.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "json_util_test",
    srcs = ["json_util_test.cc"],
    deps = [
        ":json_util",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_format",
    srcs = ["jwt_format.cc"],
    hdrs = ["jwt_format.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":json_util",
        "//:crypto_format",
        "//jwt:raw_jwt",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:endian",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "jwt_format_test",
    srcs = ["jwt_format_test.cc"],
    deps = [
        ":json_util",
        ":jwt_format",
        "//jwt:raw_jwt",
        "//proto:tink_cc_proto",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_mac_impl",
    srcs = ["jwt_mac_impl.cc"],
    hdrs = ["jwt_mac_impl.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_mac_internal",
        "//:mac",
        "//jwt:jwt_mac",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "jwt_mac_impl_test",
    srcs = ["jwt_mac_impl_test.cc"],
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_mac_impl",
        ":jwt_mac_internal",
        "//:mac",
        "//jwt:jwt_mac",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:common_cc_proto",
        "//subtle:hmac_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_hmac_key_manager",
    srcs = ["jwt_hmac_key_manager.cc"],
    hdrs = ["jwt_hmac_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_mac_impl",
        ":jwt_mac_internal",
        ":raw_jwt_hmac_key_manager",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:input_stream",
        "//:mac",
        "//internal:fips_utils",
        "//jwt:jwt_mac",
        "//proto:common_cc_proto",
        "//proto:jwt_hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:hmac_boringssl",
        "//subtle:random",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:input_stream_util",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_test(
    name = "jwt_hmac_key_manager_test",
    srcs = ["jwt_hmac_key_manager_test.cc"],
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_hmac_key_manager",
        ":jwt_mac_internal",
        "//:core/key_manager_impl",
        "//:mac",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:jwt_hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//util:istream_input_stream",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_mac_wrapper",
    srcs = ["jwt_mac_wrapper.cc"],
    hdrs = ["jwt_mac_wrapper.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_format",
        ":jwt_mac_internal",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//jwt:jwt_mac",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_test(
    name = "jwt_mac_wrapper_test",
    srcs = ["jwt_mac_wrapper_test.cc"],
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_hmac_key_manager",
        ":jwt_mac_internal",
        ":jwt_mac_wrapper",
        "//:cleartext_keyset_handle",
        "//:keyset_manager",
        "//:primitive_set",
        "//:registry",
        "//config:global_registry",
        "//jwt:jwt_mac",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:jwt_hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "raw_jwt_ecdsa_sign_key_manager",
    srcs = ["raw_jwt_ecdsa_sign_key_manager.cc"],
    hdrs = ["raw_jwt_ecdsa_sign_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    visibility = ["//visibility:public"],
    deps = [
        ":raw_jwt_ecdsa_verify_key_manager",
        "//:core/private_key_type_manager",
        "//:core/template_util",
        "//:public_key_sign",
        "//internal:ec_util",
        "//internal:fips_utils",
        "//proto:common_cc_proto",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:ecdsa_sign_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "raw_jwt_ecdsa_sign_key_manager_test",
    srcs = ["raw_jwt_ecdsa_sign_key_manager_test.cc"],
    deps = [
        ":raw_jwt_ecdsa_sign_key_manager",
        ":raw_jwt_ecdsa_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:ec_util",
        "//proto:ecdsa_cc_proto",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:ecdsa_verify_boringssl",
        "//util:enums",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "raw_jwt_ecdsa_verify_key_manager",
    srcs = ["raw_jwt_ecdsa_verify_key_manager.cc"],
    hdrs = ["raw_jwt_ecdsa_verify_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    visibility = ["//visibility:public"],
    deps = [
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:public_key_verify",
        "//internal:ec_util",
        "//internal:fips_utils",
        "//proto:common_cc_proto",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:ecdsa_verify_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "raw_jwt_ecdsa_verify_key_manager_test",
    srcs = ["raw_jwt_ecdsa_verify_key_manager_test.cc"],
    deps = [
        ":raw_jwt_ecdsa_sign_key_manager",
        ":raw_jwt_ecdsa_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:ec_util",
        "//proto:ecdsa_cc_proto",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:ecdsa_sign_boringssl",
        "//util:enums",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "raw_jwt_rsa_ssa_pkcs1_sign_key_manager",
    srcs = ["raw_jwt_rsa_ssa_pkcs1_sign_key_manager.cc"],
    hdrs = ["raw_jwt_rsa_ssa_pkcs1_sign_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    visibility = ["//visibility:public"],
    deps = [
        ":raw_jwt_rsa_ssa_pkcs1_verify_key_manager",
        "//:core/private_key_type_manager",
        "//:core/template_util",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:fips_utils",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:jwt_rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//signature:sig_util",
        "//subtle:rsa_ssa_pkcs1_sign_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "raw_jwt_rsa_ssa_pkcs1_sign_key_manager_test",
    srcs = ["raw_jwt_rsa_ssa_pkcs1_sign_key_manager_test.cc"],
    deps = [
        ":raw_jwt_rsa_ssa_pkcs1_sign_key_manager",
        ":raw_jwt_rsa_ssa_pkcs1_verify_key_manager",
        "//:public_key_sign",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//proto:jwt_rsa_ssa_pkcs1_cc_proto",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:rsa_ssa_pkcs1_verify_boringssl",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "raw_jwt_rsa_ssa_pkcs1_verify_key_manager",
    srcs = ["raw_jwt_rsa_ssa_pkcs1_verify_key_manager.cc"],
    hdrs = ["raw_jwt_rsa_ssa_pkcs1_verify_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    visibility = ["//visibility:public"],
    deps = [
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:fips_utils",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:jwt_rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:rsa_ssa_pkcs1_verify_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@boringssl//:crypto",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "raw_jwt_rsa_ssa_pkcs1_verify_key_manager_test",
    srcs = ["raw_jwt_rsa_ssa_pkcs1_verify_key_manager_test.cc"],
    deps = [
        ":raw_jwt_rsa_ssa_pkcs1_sign_key_manager",
        ":raw_jwt_rsa_ssa_pkcs1_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:jwt_rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:rsa_ssa_pkcs1_sign_boringssl",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "raw_jwt_rsa_ssa_pss_sign_key_manager",
    srcs = ["raw_jwt_rsa_ssa_pss_sign_key_manager.cc"],
    hdrs = ["raw_jwt_rsa_ssa_pss_sign_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    visibility = ["//visibility:public"],
    deps = [
        ":raw_jwt_rsa_ssa_pss_verify_key_manager",
        "//:core/private_key_type_manager",
        "//:core/template_util",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:fips_utils",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:jwt_rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//signature:sig_util",
        "//subtle:rsa_ssa_pss_sign_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "raw_jwt_rsa_ssa_pss_sign_key_manager_test",
    srcs = ["raw_jwt_rsa_ssa_pss_sign_key_manager_test.cc"],
    deps = [
        ":raw_jwt_rsa_ssa_pss_sign_key_manager",
        "//:public_key_sign",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:jwt_rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:rsa_ssa_pss_verify_boringssl",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "raw_jwt_rsa_ssa_pss_verify_key_manager",
    srcs = ["raw_jwt_rsa_ssa_pss_verify_key_manager.cc"],
    hdrs = ["raw_jwt_rsa_ssa_pss_verify_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    visibility = ["//visibility:public"],
    deps = [
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:fips_utils",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:jwt_rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:rsa_ssa_pss_verify_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@boringssl//:crypto",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "raw_jwt_rsa_ssa_pss_verify_key_manager_test",
    srcs = ["raw_jwt_rsa_ssa_pss_verify_key_manager_test.cc"],
    deps = [
        ":raw_jwt_rsa_ssa_pss_sign_key_manager",
        ":raw_jwt_rsa_ssa_pss_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:jwt_rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:common_enums",
        "//subtle:rsa_ssa_pss_sign_boringssl",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "jwt_public_key_sign_impl",
    srcs = ["jwt_public_key_sign_impl.cc"],
    hdrs = ["jwt_public_key_sign_impl.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_format",
        ":jwt_public_key_sign_internal",
        "//:public_key_sign",
        "//jwt:raw_jwt",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "jwt_public_key_verify_impl",
    srcs = ["jwt_public_key_verify_impl.cc"],
    hdrs = ["jwt_public_key_verify_impl.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_public_key_verify_internal",
        "//:public_key_verify",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "jwt_public_key_sign_verify_impl_test",
    srcs = ["jwt_public_key_sign_verify_impl_test.cc"],
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_public_key_sign_impl",
        ":jwt_public_key_verify_impl",
        "//internal:ec_util",
        "//jwt:jwt_public_key_sign",
        "//jwt:jwt_public_key_verify",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//subtle:common_enums",
        "//subtle:ecdsa_sign_boringssl",
        "//subtle:ecdsa_verify_boringssl",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_ecdsa_sign_key_manager",
    srcs = ["jwt_ecdsa_sign_key_manager.cc"],
    hdrs = ["jwt_ecdsa_sign_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_ecdsa_verify_key_manager",
        ":jwt_public_key_sign_impl",
        ":jwt_public_key_sign_internal",
        ":raw_jwt_ecdsa_sign_key_manager",
        "//:core/private_key_type_manager",
        "//:core/template_util",
        "//:public_key_sign",
        "//internal:fips_utils",
        "//jwt:jwt_public_key_sign",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "jwt_ecdsa_verify_key_manager",
    srcs = ["jwt_ecdsa_verify_key_manager.cc"],
    hdrs = ["jwt_ecdsa_verify_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_public_key_verify_impl",
        ":jwt_public_key_verify_internal",
        ":raw_jwt_ecdsa_verify_key_manager",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:public_key_verify",
        "//internal:fips_utils",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_test(
    name = "jwt_ecdsa_sign_verify_key_manager_test",
    srcs = ["jwt_ecdsa_sign_verify_key_manager_test.cc"],
    deps = [
        ":json_util",
        ":jwt_ecdsa_sign_key_manager",
        ":jwt_ecdsa_verify_key_manager",
        ":jwt_format",
        ":jwt_public_key_sign_internal",
        ":jwt_public_key_verify_internal",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_public_key_sign_wrapper",
    srcs = ["jwt_public_key_sign_wrapper.cc"],
    hdrs = ["jwt_public_key_sign_wrapper.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_format",
        ":jwt_public_key_sign_internal",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//jwt:jwt_public_key_sign",
        "//jwt:raw_jwt",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
    ],
)

cc_library(
    name = "jwt_public_key_verify_wrapper",
    srcs = ["jwt_public_key_verify_wrapper.cc"],
    hdrs = ["jwt_public_key_verify_wrapper.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_format",
        ":jwt_public_key_verify_internal",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//jwt:jwt_public_key_verify",
        "//jwt:jwt_validator",
        "//jwt:verified_jwt",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_test(
    name = "jwt_public_key_wrappers_test",
    srcs = ["jwt_public_key_wrappers_test.cc"],
    deps = [
        ":json_util",
        ":jwt_ecdsa_sign_key_manager",
        ":jwt_ecdsa_verify_key_manager",
        ":jwt_format",
        ":jwt_public_key_sign_internal",
        ":jwt_public_key_sign_wrapper",
        ":jwt_public_key_verify_wrapper",
        "//:cleartext_keyset_handle",
        "//:keyset_manager",
        "//:primitive_set",
        "//:registry",
        "//config:global_registry",
        "//jwt:jwt_public_key_sign",
        "//jwt:jwt_public_key_verify",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:jwt_ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_rsa_ssa_pkcs1_sign_key_manager",
    srcs = ["jwt_rsa_ssa_pkcs1_sign_key_manager.cc"],
    hdrs = ["jwt_rsa_ssa_pkcs1_sign_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_public_key_sign_impl",
        ":jwt_public_key_sign_internal",
        ":jwt_rsa_ssa_pkcs1_verify_key_manager",
        ":raw_jwt_rsa_ssa_pkcs1_sign_key_manager",
        "//:core/private_key_type_manager",
        "//:core/template_util",
        "//:public_key_sign",
        "//internal:fips_utils",
        "//jwt:jwt_public_key_sign",
        "//proto:jwt_rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "jwt_rsa_ssa_pkcs1_verify_key_manager",
    srcs = ["jwt_rsa_ssa_pkcs1_verify_key_manager.cc"],
    hdrs = ["jwt_rsa_ssa_pkcs1_verify_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_public_key_verify_impl",
        ":jwt_public_key_verify_internal",
        ":raw_jwt_rsa_ssa_pkcs1_verify_key_manager",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:public_key_verify",
        "//internal:fips_utils",
        "//proto:jwt_rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_test(
    name = "jwt_rsa_ssa_pkcs1_sign_verify_key_manager_test",
    srcs = ["jwt_rsa_ssa_pkcs1_sign_verify_key_manager_test.cc"],
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_public_key_sign_internal",
        ":jwt_public_key_verify_internal",
        ":jwt_rsa_ssa_pkcs1_sign_key_manager",
        ":jwt_rsa_ssa_pkcs1_verify_key_manager",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:jwt_rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_rsa_ssa_pss_sign_key_manager",
    srcs = ["jwt_rsa_ssa_pss_sign_key_manager.cc"],
    hdrs = ["jwt_rsa_ssa_pss_sign_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_public_key_sign_impl",
        ":jwt_public_key_sign_internal",
        ":jwt_rsa_ssa_pss_verify_key_manager",
        ":raw_jwt_rsa_ssa_pss_sign_key_manager",
        "//:core/private_key_type_manager",
        "//:core/template_util",
        "//:public_key_sign",
        "//internal:fips_utils",
        "//jwt:jwt_public_key_sign",
        "//proto:jwt_rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "jwt_rsa_ssa_pss_verify_key_manager",
    srcs = ["jwt_rsa_ssa_pss_verify_key_manager.cc"],
    hdrs = ["jwt_rsa_ssa_pss_verify_key_manager.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        ":jwt_public_key_verify_impl",
        ":jwt_public_key_verify_internal",
        ":raw_jwt_rsa_ssa_pss_verify_key_manager",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:public_key_verify",
        "//internal:fips_utils",
        "//proto:jwt_rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_test(
    name = "jwt_rsa_ssa_pss_sign_verify_key_manager_test",
    srcs = ["jwt_rsa_ssa_pss_sign_verify_key_manager_test.cc"],
    deps = [
        ":json_util",
        ":jwt_format",
        ":jwt_public_key_sign_internal",
        ":jwt_public_key_verify_internal",
        ":jwt_rsa_ssa_pss_sign_key_manager",
        ":jwt_rsa_ssa_pss_verify_key_manager",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//proto:jwt_rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "jwt_public_key_sign_internal",
    hdrs = ["jwt_public_key_sign_internal.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        "//jwt:raw_jwt",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "jwt_mac_internal",
    hdrs = ["jwt_mac_internal.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        "//jwt:jwt_validator",
        "//jwt:raw_jwt",
        "//jwt:verified_jwt",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "jwt_public_key_verify_internal",
    hdrs = ["jwt_public_key_verify_internal.h"],
    include_prefix = "tink/jwt/internal",
    deps = [
        "//jwt:jwt_validator",
        "//jwt:verified_jwt",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)
